/** @example testast.c
*/
#include "ast.h"
#include "printers.h"
#include "memblock.h"
#include <stdio.h>
#include <stdlib.h>


int vxpExit(struct MemBlockInfo* mem, int status)
{
	memFree(mem);
	exit(status);
}

int main()
{
    struct Node* root;
	struct MemBlockInfo* mem;
    struct Node* expr=NULL;
    struct Node* pathexpr=NULL;
	struct Node* andexpr=NULL;
	struct Node* predicate=NULL;

	mem=memInit(sizeof(struct Node));

    expr=newRule(mem, Expr,0);
	root=expr;
	pathexpr=newRule(mem,PathExpr,0);
	andexpr=newRule(mem,AndExpr,0);
	predicate=newRule(mem,Predicate,0);

	nodeAppendChild(mem,expr,pathexpr);
	nodeInsertRight(mem,expr,predicate);
	nodeInsertRight(mem,pathexpr,andexpr);

    printXPath10(root,PRINT_TEXT);

	return vxpExit(mem,0);
}

